home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / mntlb20 / lib / _fltsisf.s < prev    next >
Text File  |  1992-05-17  |  546b  |  34 lines

  1. |
  2. | long integer to single float conversion routine
  3. |
  4. | Andreas Schwab (schwab@ls5.informatik.uni-dortmund.de)
  5. |  mostly copied from _floatsi.cpp
  6.  
  7.  
  8.  
  9.  
  10.  
  11. BIAS4    =    0x7F-1
  12.  
  13.     .text
  14.     .even
  15.     .globl    ___floatsisf
  16.  
  17. ___floatsisf:
  18.     moveml    d2-d5,sp@-    | save registers to make norm_sf happy
  19.  
  20.     movel    sp@(20),d4    | prepare result mantissa
  21.     movew    #BIAS4+32-8,d0    | radix point after 32 bits
  22.     movel    d4,d2        | set sign flag
  23.     swap    d2
  24.     tstw    d2        | check sign of number
  25.     bge    1f        | nonnegative
  26.     negl    d4        | take absolute value
  27. 1:
  28.     clrw    d1        | set rounding = 0
  29.     jmp    norm_sf
  30.  
  31.  
  32.  
  33.  
  34.